/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package reprortes;

import apiAccess.APIAccess;
import apiAccess.APIEXception;
import java.io.IOException;
import java.util.List;
import org.xml.sax.SAXException;

/**
 *
 * @author w
 */
public class Ranking implements ProductLister {

    private List<Integer> idList;
    private List<Integer> rankingList;
    private List<String> nameList;

    public Ranking() throws SAXException, IOException, APIEXception{
        APIAccess.rankingCalculate(11);
        idList=APIAccess.rankingGetIdeList();
        nameList=APIAccess.rankingGetNameList();
        rankingList=APIAccess.rankingGetRankingList();
    }

    public List<Integer> productList(){
        return idList;
    }

    public String number(int n){
        return rankingList.get(n) + "#";
    }

    public String name(int n){
        return nameList.get(n);
    }

    public int size(){
        return idList.size();
    }
}
